The invention relates to a method and arrangement for adding field images of an interlaced video frame image received in the form of frame-encoded transform blocks obtained by an image transform.
The invention also relates to a method and arrangement for detecting a watermark embedded in the fields of a plurality of interlaced video frames.
Some video processing applications require the two fields of an interlaced video frame to be added or averaged. An example of such an application is watermark detection. International Patent Application WO-A-99/45705 discloses a video watermarking system in which the same watermark is embedded in successive fields of a video signal. The watermark detector of this system accumulates the fields over a number of frames so that the video signal averages to zero, whereas the watermark adds constructively.
Adding (or averaging) the two fields of an interlaced video frame is trivial in the pixel domain, but far from trivial in the digital (MPEG) domain. The reason is that MPEG encoders may have joined the fields of a frame prior to encoding, and produce so-called frame_pictures with DCT blocks containing information from both odd and even fields.
FIGS. 1 and 2 show diagrams to illustrate the problem underlying this invention. FIG. 1 shows one of MPEG""s modes of encoding pictures. In this encoding mode, known as frame_pictures with frame_encoded macroblocks, the two fields 11 and 12 are joined together to a frame 13 by interleaving the lines from the two fields. Both fields have the same watermark W embedded. The frame is then subjected to a discrete cosine transform (DCT), which transforms blocks of 8xc3x978 pixels into blocks of 8xc3x978 coefficients. Four DCT blocks collectively constitute a macroblock 14. Each DCT block represents half of the pixels from the first field 11 and half of the pixels from the second field 12.
Because the DCT is a linear transform, the effect of adding DCT-coefficients is the same as adding the corresponding pixels. Accordingly, the accumulation of frames carried out by the watermark detector may be performed in the DCT domain. The inverse DCT may be postponed until after the accumulation is completed. However, the accumulation requires a frame-based memory. Accordingly, the watermark detector of the system disclosed in WO-A-99/45705, in which 128xc3x97128 watermark patterns are tiled over each field, requires a 256xc3x97128 buffer.
Another trivial way to add the two fields is to perform the inverse DCT on every block as it arrives, then add the odd lines to the even lines, and store the result in a memory. This option only needs a field-based memory (i.e. a 128xc3x97128 buffer in the watermark detector), but requires an on-the-fly inverse DCT transform on every DCT block, which is neither attractive from an implementation point of view.
FIG. 2 shows another one of MPEG""s modes of encoding pictures. In this encoding mode, known as frame_pictures with field_encoded macroblocks, the two fields 11 and 12 are joined together to a frame 15 by taking 8 consecutive lines from the first field 11, followed by the same 8 lines from the second field 12. The frame is DCT-transformed. Four DCT blocks collectively constitute a macroblock 16. In this encoding mode, a macroblock contains blocks from one field and blocks from the other field, but all of the pixels represented by one DCT block are from the same field. Because the DCT is a linear transform, the effect of adding DCT-coefficients is the same as adding the corresponding pixels. Accordingly, the two vertically adjacent DCT blocks of each macroblock 16 may be added together in the DCT domain. This operation requires a field-based memory. The inverse DCT may be postponed until after the accumulation of all frames is completed. However, this straightforward solution cannot easily be combined with the above-mentioned solutions for adding the fields of frame-encoded macroblocks.
In practice, MPEG frame pictures contain a mix of frame-encoded macroblocks and field-encoded macroblocks. The majority (70.85%) of the macroblocks is frame-encoded. The technically most awkward situation is thus also the most common.
It is an object of the invention to provide a method and arrangement for adding fields of an interlaced video image frame, with which the above-mentioned problems are alleviated.
To achieve these and other objects, the method in accordance with the invention comprises the steps of multiplying the frame-encoded blocks with a sparse matrix which is representative of the inverse image transform, field addition, and a predetermined basis transform; and subjecting the result of said multiplication to the inverse of said predetermined basis transform.
The invention exploits the mathematical insight that the operations of inverse DCT and field addition may be followed by a basis transform which is subsequently undone by the inverse of said basis transform. The composed operations (inverse DCT, field addition, and basis transform) are now physically replaced by a single matrix multiplication. The basis transform is chosen to be such that said matrix multiplication is a multiplication with a sparse matrix, i.e. a matrix with few non-zero elements. The sparse matrix multiplication is carried out on-the-fly, but is much easier to implement than an on-the-fly inverse DCT. The method requires a field-based memory only. A further significant advantage of the invention is that execution of the inverse basis transform can be postponed until after all frames (20 or so for watermark detection) have been accumulated in the field memory.